package cc.xuzhi.muggle.devtools.service;

import cc.xuzhi.muggle.devtools.mapper.TableMapper;
import cc.xuzhi.muggle.devtools.model.TableInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TableService {

    @Autowired
    private TableMapper tableMapper;

    /**
     * 判断table是否存在
     * @param tableName
     * @return
     */
    public boolean checkTableExist(String tableName) {
        TableInfo tableInfo = tableMapper.findTableByName(tableName);

        return tableInfo != null;
    }
}
